using UnityEngine;
using System.Collections;

public class ItemBehavior : MonoBehaviour {

	public string type;

	void Start(){
		GameController GameController = Camera.main.GetComponent<GameController>();
	}
	

	void Update(){
		//transform.Rotate(0.0f,-120 * Time.deltaTime,0.0f);
		foreach (GameObject jogador in GameController.jogadores) {
				if (jogador == null)
						continue;
				Bounds item = this.gameObject.renderer.bounds;
				Bounds player = jogador.renderer.bounds;
				if (item.Intersects (player)) {
					Jogador scriptJogador = jogador.GetComponent<Jogador>();
					scriptJogador.setBoost(type);
					Debug.Log("colidi");
					Destroy (this.gameObject);
				}
		}
		
	}
	
}
